<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //编写一个函数，实现任意个任意数字的求 和 或 积 的函数
        (function(){
            var a=arguments[0],b=arguments[0]
            for(var i in arguments){
                // console.log('===>',arguments[Number(i)+1],i+1,typeof (Number(i)+1))
                if(i>arguments.length-2){
                    break
                }
                a+=arguments[Number(i)+1]
                b*=arguments[Number(i)+1]
            }
            console.log('和'+a,'积'+b)
        })(100,22)

    </script>
</body>
</html>